#!/usr/bin/perl
use strict;
use warnings FATAL => 'all';
#use utf8;

my $fred = 0;
my $barney = 0;
sub sum_of_fred_and_barney {
    print "Hey, you called the sum_of_fred_and_barney suroutine!\n";
    $fred + $barney;  # 返回值
#    print "I'm called";
}

sub larger_of_fred_or_barney {
    if($fred > $barney) {
        $fred;
    } else {
        $barney;
    }
}

my $sum = &sum_of_fred_and_barney;
print STDOUT "${sum}";

$fred = 0;
$barney = 123;
print &larger_of_fred_or_barney;
